package cn.cnsuh.剑指offer.q09_用两个栈实现队列;

import java.util.Stack;

public class Main {
    static Stack<Integer> A,B;
    static void CQueue(){
        A = new Stack<>();
        B = new Stack<>();
    }
    static void appendTail(int value) {
        A.add(value);
    }
    static int deleteHead() {
        if(A.empty()){
            return -1;
        }
        while(!A.empty()){
            B.add(A.remove(0));
        }
        int res = B.remove(0);
        while(!B.empty()){
            A.add(B.remove(0));
        }
        return res;
    }
}
